Skip to content

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Sep 25, 2025

Backport a3d7c46

Requested by: @brad0

@llvmbot llvmbot requested a review from a team as a code owner September 25, 2025 03:51
@llvmbot llvmbot added this to the LLVM 21.x Release milestone Sep 25, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Sep 25, 2025
@llvmbot
Copy link
Member Author

llvmbot commented Sep 25, 2025

@wzssyqa What do you think about merging this PR to the release branch?

@llvmbot
Copy link
Member Author

llvmbot commented Sep 25, 2025

@llvm/pr-subscribers-libunwind

Author: None (llvmbot)

Changes

Backport a3d7c46

Requested by: @brad0


Full diff: https://github.com/llvm/llvm-project/pull/160638.diff

1 Files Affected:

  • (modified) libunwind/src/UnwindRegistersRestore.S (+5-2)
diff --git a/libunwind/src/UnwindRegistersRestore.S b/libunwind/src/UnwindRegistersRestore.S
index 5e199188945df..1bcd205be260d 100644
--- a/libunwind/src/UnwindRegistersRestore.S
+++ b/libunwind/src/UnwindRegistersRestore.S
@@ -1044,9 +1044,10 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind18Registers_mips_o326jumptoEv)
   lw    $27, (4 * 27)($4)
   lw    $28, (4 * 28)($4)
   lw    $29, (4 * 29)($4)
-  lw    $30, (4 * 30)($4)
   // load new pc into ra
   lw    $31, (4 * 32)($4)
+  // MIPS 1 has load delay slot. Ensure lw $31 and jr are separated by an instruction.
+  lw    $30, (4 * 30)($4)
   // jump to ra, load a0 in the delay slot
   jr    $31
   lw    $4, (4 * 4)($4)
@@ -1082,11 +1083,13 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind21Registers_mips_newabi6jumptoEv)
   ld    $2, (8 * 2)($4)
   ld    $3, (8 * 3)($4)
   // skip a0 for now
-  .irp i,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
+  .irp i,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29
     ld $\i, (8 * \i)($4)
   .endr
   // load new pc into ra
   ld    $31, (8 * 32)($4)
+  // MIPS 1 has load delay slot. Ensure lw $31 and jr are separated by an instruction.
+  ld    $30, (8 * 30)($4)
   // jump to ra, load a0 in the delay slot
   jr    $31
   ld    $4, (8 * 4)($4)

@nikic nikic moved this from Needs Triage to Needs Review in LLVM Release Status Sep 25, 2025
@github-project-automation github-project-automation bot moved this from Needs Review to Needs Merge in LLVM Release Status Sep 26, 2025
@dyung
Copy link
Collaborator

dyung commented Oct 1, 2025

@brad0 and @wzssyqa, can you confirm that the premerge test failures are not due to your change?

@brad0
Copy link
Contributor

brad0 commented Oct 2, 2025

@brad0 and @wzssyqa, can you confirm that the premerge test failures are not due to your change?

Looks like there is something wrong with the AIX CI environments.

…delay (llvm#152942)

Fix llvm#152922

MIPS III also has load delay, so
libunwind::Registers_mips_newabi::jumpto() is also fixed.

(cherry picked from commit a3d7c46)
@ldionne
Copy link
Member

ldionne commented Oct 9, 2025

The CI failures can be ignored here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Merge

Development

Successfully merging this pull request may close these issues.

6 participants